﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dbPoll_Application.Models.ManageAccountsModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Manage Accounts
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script src="../../Scripts/Account-ManageAccounts.js" type="text/javascript"></script>
    
    <div class="pageHeadingContainer"><h2 class="pageHeading">Manage Accounts</h2></div>
    <div id="pageMenuContainer">
        <ul id="pageMenu">
            <% if (Page.User.IsInRole("System Administrator"))
               { %>
               <li><%= Html.ActionLink("Poll Administrator", "AccountManager", "Account", new { role = "Poll Administrator" }, null)%></li>
            <% } 
               if (Page.User.IsInRole("Poll Administrator"))
               { %>
               <li><%= Html.ActionLink("Poll Creator", "AccountManager", "Account", new { role = "Poll Creator" }, null)%></li>
            <% } 
               if (Page.User.IsInRole("Poll Creator"))
               { %>
               <li><%= Html.ActionLink("Poll Master", "AccountManager", "Account", new { role = "Poll Master" }, null)%></li>
            <% } 
               if (Page.User.IsInRole("Poll Master"))
               { %>
               <li><%= Html.ActionLink("Poll User", "AccountManager", "Account", new { role = "Poll User" }, null)%></li>
            <% } %>
        </ul>
    </div>
    <div id="contentContainer">
    <p>Select an account to manage from the list or create a new account by selecting the type of user you want
    to create from the menu.</p>
    <table class="users">
    <% 
        Html.RenderPartial("UserListAll", Model);
    %>
    </table>

        <div id="deleteUserDialogContainer" class="none">
            <div id="deleteUserDialog">
                <div id="deleteUserHeading">Delete Confirmation</div>
                <div id="deleteUserContent">You have chosen to delete a user, click OK to confirm.
                    <div id="deleteUserButtons"><input type="button" id="deleteUserOK" value="OK" /><input type="button" id="deleteUserCancel" value="Cancel" /></div>
                </div>
            </div>
        </div>
        
    </div>

</asp:Content>
